/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package jobscheduling.model;

import java.io.Serializable;

/**
 *
 * @author bursant
 */
public class Job implements Serializable{
    public int id;
    public int[] tasks;

    public void setTaskDuration(int index, int duration){
        tasks[index] = duration;
    }

    public void setMachineNumber(int number){
        int[] newTasks = new int[number];
        int i = 0;
        while (i < number && i < tasks.length){
            newTasks[i] = tasks[i];
            i++;
        }
        tasks = newTasks;
    }

    public Job(int i, int len){
        id = i;
        tasks = new int[len];
    }

    public String toString(){
        return "job nr: " + id;
    }
}
